#pragma once

#include "IXTextEnv.h"
#include "Logic/Include/XBaseObjImpl.h"

class CXTextEnvImpl : public CXBaseObjImpl<IXTextEnv>
{
    typedef CXBaseObjImpl<IXTextEnv> superclass;
    BEGIN_DEF_SKIN_CLASS(CXTextEnvImpl, superclass, gs_strGuidXSkin)
        IMP_BASIC_INTF(IXTextEnv,     0)
        IMP_BASIC_INTF(IXDrawContextObj, eIntf_NoCreate)
    END_DEF_SKIN_CLASS();

public:
    CXTextEnvImpl();
    virtual ~CXTextEnvImpl();

public:
    // IXDrawContextObj
    virtual void STDMETHODCALLTYPE   SetupCanvas(XCANVAS canvas);
    virtual void STDMETHODCALLTYPE   RestoreCanvas(XCANVAS canvas);
    virtual XHANDLE STDMETHODCALLTYPE get_DrawObj();

public:
    // IXTextEnv
    virtual void STDMETHODCALLTYPE   put_TextColor(COLORREF clrText);
    virtual void STDMETHODCALLTYPE   put_BackColor(COLORREF clrBkText);
    virtual void STDMETHODCALLTYPE   put_Transparent(BOOL bTrans);
    virtual void STDMETHODCALLTYPE   put_DrawFlags(DWORD dwFlags);

    virtual COLORREF STDMETHODCALLTYPE   get_TextColor();
    virtual COLORREF STDMETHODCALLTYPE   get_BkColor();
    virtual BOOL     STDMETHODCALLTYPE   get_Transparent();
    virtual DWORD    STDMETHODCALLTYPE   get_DrawFlags();

    virtual void    STDMETHODCALLTYPE   put_Singleline(IN BOOL bSingleline);
    virtual BOOL    STDMETHODCALLTYPE   get_Singleline();
protected:
    COLORREF    m_clrText;
    COLORREF    m_clrTextBk;
    BOOL        m_bTransparent;
    DWORD       m_dwDrawFlags;

    COLORREF    m_clrOldText;
    COLORREF    m_clrOldTextBk;
    BOOL        m_bOldTransparent;
};

